@extends('admin.layout')
@section('title',$title)
@section('content')
<div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
               用户管理
                <small>用户管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="#">用户编辑</a></li>
                <li class="active">用户编辑</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">用户编辑</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        @if(count($errors)>0)
                            <div class="alert alert-danger alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&time;</button>
                            <h4><i class="icon fa fa-ban"></i>警告！</h4>
                            <ol>
                                @foreach($errors->all()as $error)
                                <li>{{$error}}</li>
                                @endforeach

                            </ol>
                            </div>
                            @endif

                        <form role="form" action="/admin/user/update"method="post" enctype="multipart/form-data">
                        {{ csrf_field() }}
                        <input type="hidden" name="id" value="{{$data ->id}}"></input>
                        <input type="hidden" name="oldpic" value="{{$data ->pic}}"></input>

                            <div class="box-body">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">用户名</label>
                                    <input type="text" value="{{$data ->username}}" name = "username"  class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入用户名">
                                </div>
                                
                                 <div class="form-group">
                                    <label for="exampleInputPassword1">电话</label>
                                    <input type="text" name = "phone" value="{{$data ->phone}}" class="form-control" id="exampleInputPassword1"
                                           placeholder="请输入电话号码">
                                </div>
                                 <div class="form-group">
                                    <label for="exampleInputPassword1">邮箱</label>
                                    <input type="email" name = "email" value="{{$data ->email}}" class="form-control" id="exampleInputPassword1"
                                           placeholder="邮箱">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputFile">原始头像</label>
                                    <img src="{{$data->pic}}" width="200"/>
                                   
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputFile">上传头像</label>
                                    <input type="file" name = "pic" id="exampleInputFile">
                                   
                                </div>
                                
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">更新</button>
                                <button type="reset" class="btn btn-danger">重置</button>
                            </div>
                            
                        </form>
                    </div><!-- /.box -->               
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!--/.col (right) -->
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    @endsection